<?php
/**
* 后端管理入口
**/
header("content-type:text/html;charset=utf-8");
//header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers:jwtToken");
error_reporting(E_ALL); 
ini_set('display_errors','On');

defined('YII_DEB;UG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');

defined('PROJECT_NAME') or define('PROJECT_NAME', 'appapi');
defined('BASE_PATH') or define('BASE_PATH', dirname(dirname(__DIR__)));
defined('VENDOR_PATH') or define('VENDOR_PATH', dirname(dirname(__DIR__)) . '/vendor');

require BASE_PATH . '/heihei/Heihei.php';

//导入模块配置
$modulePaths = [
    dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'extendapps',
    dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'apps'
];
Heihei::loadModules($modulePaths);

defined('APP_BASE_PATH') or define('APP_BASE_PATH', BASE_PATH . '/apps/' . PROJECT_NAME);
require BASE_PATH . '/common/config/bootstrap.php';
require APP_BASE_PATH . '/config/bootstrap.php';
$config = yii\helpers\ArrayHelper::merge(
    require BASE_PATH . '/common/config/main.php',
    require BASE_PATH . '/common/config/main-local.php',
    require APP_BASE_PATH . '/config/main.php',
    require APP_BASE_PATH . '/config/main-local.php'
);
(new heihei\web\Application($config))->run();

